<!doctype html>
<html lang="zh-cmn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/forget.css"/>
<link rel="stylesheet" href="css/layui.css"/>
<title>密码找回</title>
</head>
<body>
<div class="background"></div>
<div class="main">
	 <div class="header">
        <div class="portal-logo">
            <img style="height:100%" src="images/hbug.png"/>
        </div>
		<div class="portal-title">
        会议室预约系统
        </div>
    </div>
	<div class="container">
        <div class="notice-panel">
            <div class="notice-box">
                <div class="notice-title">
                系统使用说明
                </div>
                <div class="notice-break-line"></div>
                <div class="notice-content">
                <p>1、会议室实行网上预约使用与管理。注意：最晚提前一天进行预约。</p>
				<p>2、若使用QQ邮箱注册，用户可通过QQ邮箱绑定微信来接收消息。</p>
				<p>3、会议室预约时段为：8:00-18：00，超时段使用应在预约登记时做好备注说明。(提示：预约时间必须落在系统划定时间段内，时间需按照系统原有时间格式输入）</p>
                <p>4、建议使用电脑设备访问本系统。</p>
                <p>5、如会议室多媒体设备使用前发生故障、损坏或配件丢失，要及时上报综合办公室，未及时上报发现后责任一律由最后使用人承担。</p>
				<p>6、其他特殊情况或特殊需要用户可联系综合办公室。</p>
                </div>
            </div>
        </div>
        <div class="login-panel">
            <div class="login-box">
            
            <div id="nav" class="login-nav only-auth">
          
                <div class="on" data-type="local" id="local">密码找回</div>
         
            </div>
                <form class="el-form el-form--label-top" onsubmit="return false">
                    <input name="auth_type" type="hidden" value="local"/>
                    <div class="wechat-qrcode" style="margin-top: 20px">
                        
                        <div id="wechat-qrcode"></div>
                        
                    </div>
                
                    <div class="login-form-item">
                        <div class="el-input user-input">
                            <input autocomplete="new-password" id="number" placeholder="教职工号"
                                   type="text" name="number">
                        </div>
                    </div>
               
                    <div class="login-form-item password-field">
                        <div class="el-input email-input">
                            <input autocomplete="new-password" id="mailbox" placeholder="邮箱" type="email" name="email">
                        </div>
                    </div>
					
					<div class="login-form-item password-field">
                        <div class="el-input code-input"> 
                            <input autocomplete="new-password" placeholder="验证码" id="code_input" type="text1" name="code1">  
                        </div>
						<div class="el-input loginCode" id="v_container"></div>
                    </div>
					
					 <div class="upper-login-field">
          
                        
                    
                    </div>
                   <button type="submit" id="my_button" onClick="submit1()" class="el-button-login" style="margin-bottom:20px;" > 
                        <span>密码找回</span>
                    </button>
					
						<a href="frontlogin.html">立即登录</a>
            			<a href="frontregister.html">立即注册</a>
                </form>
                <div class="link-field">
                
                
                </div>
                <div class="mobile-notice-panel">
                    <div class="notice-box">
                        <div class="notice-break-line"></div>
                        <div class="notice-title">
                        系统使用说明
                        </div>
                        <div class="notice-content">
                         <p>1、会议室实行网上预约使用与管理。注意：必须提前一天进行预约。</p><p>2、若使用QQ邮箱注册，用户可通过QQ邮箱绑定微信来接收消息。</p><p>3、会议室预约时段为：8:00-18：00，超时段使用应在预约登记时做好备注说明。(提示：预约时间必须落在系统划定时间段内，时间需按照系统原有时间格式输入）</p>
				<p>4、如会议室多媒体设备使用前发生故障、损坏或配件丢失，要及时上报综合办公室，未及
      			时上报发现后责任一律由最后使用人承担。</p><p>5、其他特殊情况或特殊需要用户可联系综合办公室。</p>
                        </div>
                    </div>
                </div> 
            </div>
            </div>
        </div>
</div> 
</body> 

<script src="js/script/jquery-1.10.2.min.js"></script> 
 <script src="js/script/jquery-ui-1.9.2.custom.min.js"></script> 
 <script src="js/script/jquery-migrate-1.2.1.min.js"></script> 
 <script src="js/script/bootstrap.min.js"></script> 
 <script src="js/script/modernizr.min.js"></script> 
 <script src="js/script/jquery.nicescroll.js"></script> 
 
  
<!-- lst -->
<script type="text/javascript" src="js/utilcommon.js"></script>
<script src="js/layer-v3.1.1/layer/layer.js" ></script>
<script src="js/script/wer.js"></script>
<script>
var verifyCode = new GVerify("v_container");
var num ;
var numbers;
function isnumber(){
  num  = $("#number").val();
    if( /^\d+$/.test(num) || num == ""){
        numbers = num;
       // console.log(numbers); 
       return 0;
    }else{
        layer.msg('教职工号：请输入数字');
    }
}
$("#number").on("input",function(){       
   isnumber();
});

function isEmail(){ 
  var email = $("#mailbox").val();
  if($("#mailbox").val().length != 0) {
    //  var reg =   /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
    var reg =  /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
     //调用正则验证test()函数
     isok= reg.test(email);
       if(!isok) {
            alert("邮箱格式不正确，请重新输入！");
            document.getElementById("mailbox").focus();
            return false;
        }
    };  
}


function submit1(){
  var res = verifyCode.validate(document.getElementById("code_input").value);
  if(res) {
    var number = $("#number").val();
    var mailbox = $("#mailbox").val();
    //console.log(isEmail())
    
      
    if( $("#number").val().length==0 ||  $("#mailbox").val().length==0){
        alert("请输入教职工号和邮箱")
      }else if(isEmail() !=false){
        //console.log("qingqiu")
        var url = Config.host + "/front/userforgetpw";
        var data = {
            "number": number,
            "mailbox":mailbox
        }
        var func=function(returndata){
            if (returndata.code == "999999"){
                alert("用户不存在");
            }else if (returndata.code == "888888") {
                alert("邮箱不正确");
            }else{
                alert("已为您发送邮件，请耐心等候")
            }
        }
        if(isnumber() == 0){
          AJAX.get(url,data,func);
        }
        
      }    
  }else{
      alert("验证码错误");
  }
}
  </script>
	

</html>
